package com.ijpay.service;

import com.ijpay.model.App;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.SqlPara;

/**
 * @author Javen
 */
public class AppService {
	public static final AppService me = new AppService();
	private final App dao = new App().dao();
	/**
	 * 根据appId查询app
	 * @param appId
	 * @param status
	 * @return
	 */
	public App getAppByAppId(String appId,int status){
		Kv para = Kv.by("app_id", appId).set("status", status);
		SqlPara sqlPara = dao.getSqlPara("app.getByAppId",para);
		return dao.findFirst(sqlPara);
	}
	
	/**
	 * 根据appId查询app
	 * @param appId
	 * @return
	 */
	public App getAppByAppId(String appId){
		Kv para = Kv.by("app_id", appId);
		SqlPara sqlPara = dao.getSqlPara("app.getByAppId",para);
		return dao.findFirst(sqlPara);
	}
	
	

}
